<?php session_start() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Senior Cat Companions Available for Adoption</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<? include("./includes/head.inc");  ?>

<style type="text/css">
<!--

.style5 {color: #FF0000}

.catname{
	font-size: 1.2em;
	margin-bottom:3px;
	margin-top: 0px;
	padding:0px 2px 2px 2px;
	color: white;
	text-align:center;
	font-weight:700;
	background-image: url('images/scc/redbar.jpg');
	background-repeat: no-repeat;
	text-decoration:none;
}

.smallBreak {
	line-height:6pt;
	}
div.float {
  float: left;
  margin: 1em;
  }
  
div.float p {
   text-align: center;
   }
-->
</style>

</head>

<body>

<!--initial body width and height set up  -->

<div id="bodywidth">

<? include("./includes/header.inc");  ?>
<? include("./includes/leftmenu.inc");  ?>

<!--wide2column enter here -->
<div id="wide2column">
<script language="JavaScript">
<!-- 
function open_new_window(url)
{ 
new_window = window.open(url,'window_name','toolbar=0,menubar=0,scrollbars=1,resizable=1,dependent=0,status=0,width=500,height=550,left=25,top=25')
}
// New window attributes
// url - the variable for the url of the page in the new window
// that is passed by placing it single-quoted in either the link or form
// window_name - the name of the new window being opened
// width - width of the new window in pixels
// height - height of the new window in pixels
// top - the new widow top will appear xx number of pixels from the top of the screen
// left - the new widow left margin will appear xx number of pixels from the left of the screen

// The following attributes will suppress the respective window elements
// when the value is set to zero or if omitted. When listed or equal to one
// the window attribute will appear
// toolbar,menubar,resizable,dependent,status
// -->
</script>

<!-- Rolled out as PHP for testing 3-18-02 -->
<BR>
<p style="text-align:right;color:gray;font-size:250%">Senior Cat Companions</p>
<p>&nbsp;</p>

<p>
Complete an <A HREF="./forms/catadopt.php?SCC=1">application</A> for one of these wonderful felines.<BR />
For information on declawing, please read <A HREF="declaw.htm">KAR's declaw statement.</A> </b>
<BR>
Read more about the <A HREF="./scc.htm">Senior Cat Companions</A> program.<BR /><BR />
</p>


<p style="margin-left:20px;font-size:124%;font-weight:bold;">
Select the picture for a larger image and detailed description.
</p>
<BR>

<?php


include("./includes/db.php");
include("./includes/count.php");
				// Connect to the database server
dbConnect('kar_web1');   	// Use function in db.php to connect


$numresults = @mysql_query("SELECT * FROM cats WHERE
						scc_cat=1 AND 
						pet_status='v' ");
if (!$numresults) {	
  echo("<p>Error performing query in Display Pets page: " . mysql_error() . "</p>");
  exit();
}

$num_to_display=20;  			//  how many animals we want displayed per page
$num_columns=5;				// how many columns we want those split between

$num_pets=mysql_num_rows($numresults); // how many total animals are actually available

if (empty($starting_num)){	// if this is our first page, then start at 0
	$starting_num=0;
} //  end if


// Display SCC cats and any cat in the Senior age range (greater than 5 years)
$result = @mysql_query("SELECT * FROM cats WHERE pet_status='v' AND 
 				   (TO_DAYS(NOW()) - TO_DAYS(pet_DOB) > 1825 OR scc_cat=1 )
				   LIMIT $starting_num,$num_to_display");

$count =mysql_num_rows($result);  // how many we have for this page
displayPageLinks($num_pets, $num_to_display, $starting_num, cats, 0);

//   echo("<CENTER><TABLE cellpadding=\"10\">");

for ($i = 1; $i <= $count; $i++ ) {    	// loop for number of animals in this set
	$pet_record = mysql_fetch_array($result);
	$temp_id = $pet_record["tagNum"];
	$name = $pet_record["pet_name"];
	$special = $pet_record["spec_need"];
	$declawed = $pet_record["declawed"];
	$noPhotos = $pet_record["noPhotos"];
	//  Query Pet Photos separately in case there is not a record of photos for this pet
	$pics = @mysql_query("SELECT thumb, pic1, pic2, pic3 FROM cats WHERE tagNum ='$temp_id'");
	$pet_pics = mysql_fetch_array($pics);

	if ($noPhotos) {
		$thumb = 'noPhotos.gif';	// this file is in both the dog and cat thumbnail folders
		} else {
		$thumb = $pet_pics["thumb"];
		}

	$path = "./images/cats/thmbnail/";
	$type = "cat";

		echo ("<div class =\"float\">");   // no matter what start with this

	// display pet thumbnail image and name
	echo("<a href='pets2.php?displaypet=$temp_id'><img SRC=\"". $path . $thumb . "\" align=\"$align\"  alt=\"$name\" width=\"75\" height=\"75\"></a>" );


//	echo("<BR clear=all>");
 	echo("<BR><p>");


	if ($declawed=='1'):		// declawed
		echo("<img SRC=\"images/declawed.gif\"  HSPACE=0 ALIGN=\"TOP\" WIDTH=\"19\" HEIGHT=\"19\" ALT=\"Declawed\">");
	endif;
	
	echo($name . "</p></div>");


	if ( ($i%$num_columns) == 0):	// if it's the last slot in the row, end the row
		echo("<div class=\"clearit\"></div>");
	endif;
  
}  // end for 

	echo("<div class=\"clearit\"></div>");


displayPageLinks($num_pets, $num_to_display, $starting_num, cats, 0);

?>

<BR>
 <CENTER>Don't forget to check out our other  <a href="cats.php">cats</a> and <a href="./kittens.php">kittens</a> too.<BR></CENTER><BR> 

<!-- <BR>
<img SRC="./images/sneed3.gif"  HSPACE=0 ALIGN="TOP" WIDTH="17" HEIGHT="17" ALT="Special Needs"> -- Special Needs
 --><BR>
<img SRC="./images/declawed.gif"  HSPACE=0 ALIGN="TOP" WIDTH="19" HEIGHT="19" ALT="Declawed"> -- Declawed

 <br />
</div>

<? include("./includes/footer.inc");  ?>

<!--tag below ends bodywidth div -->
</div>
</body>
</html>
